package src;

import java.util.ArrayList;

public class Rta {





	public Rta () {


	}

	ArrayList<Integer> analyze () {
		return null;
	}

	boolean dmGuarantee (ArrayList<Task> tasks) {

		//Sort tasks after their priority
		//TODO

		int I;//interference due to preemption
		int R;

		for (Task task : tasks) {
			I=0;
			R=I+task.getComputationTime();

			if (R > task.getDeadline()) {
				//Not schedulable
				return false;
			}


			//TODO: What is i in this case? Has it something to do with the previous task[i]?
			for (int j=1 ; j>i; j++) {	//If iterating over all tasks, then j shall start from 0.

				do {
					I = I + Math.ceil(R/task[j].getPeriod())*task[j].getComputationTime();

				} while (I+task[i].getComputationTime() > 0);

			}

		}
		return true;
	}

}

